/*
 * @authors :Bin Mei
 * @date    :2017-7-27
 * @description：票交汇APP-h5 -> 登录/注册成功页
 */

import React, { Component } from 'react';
import {bindActionCreators} from "redux";
import {connect} from "react-redux";
import classnames from 'classnames';
import actions from "src/store/actions";
import {Svg} from "src/components/common";
import { mmBridge} from 'min-bridge';

import './Success.scss';


class Success extends Component{
	constructor(props){
		super(props);
			this.state = {};
	}
	componentWillMount(){
		mBridge.setWebViewExterior&&mBridge.setWebViewExterior({
			type:'OPEN',
			action:{
				fullScreen:"OPEN",
				navigator:"CLOSE",
				viewBackgroundColor:"rgba(244,160,0,1)"
			}
		});
	}
	componentWillUnmount(){
		mBridge.setWebViewExterior&&mBridge.setWebViewExterior({
			type:'CLOSE'
		});
	}
	goInvset(){
		//跳转 投资列表页
		mBridge.goAppView&&mBridge.goAppView({
			type:'INVESTLIST'
		});
	}
	render(){

		return ( 
			<div className="l-success">
				<div className="success-banner">
					<img src={require("./images/success_hd.png")} alt=""/>
					<p className="text"><span className="money">588</span>元</p>
				</div>
				<section className="card-wrap">
					<header className="hd ds-box">
						<div className="item cm-flex">
							<p className="val hligh">15%</p>
							<p className="name">年化收益率 </p>
						</div>
						<div className="item cm-flex">
							<p className="val"><em>7</em>天</p>
							<p className="name">投资期限</p>
						</div>
						<div className="item cm-flex">
							<p className="val"><em>100</em>元</p>
							<p className="name">起投金额</p>
						</div>
					</header>
					<div className="card-info">
						<h4 className="i4-tit"><span className="hligh">588元</span>新友专享礼包已放入你的账户</h4>
						<p><img src={require("./images/card.png")} alt=""/></p>
						<p className="invest-btn">
							<span onClick={()=>this.goInvset()}>立即投资</span>
						</p>
					</div>
					<p className="exclusive-tag"><Svg className="newpeople" hash="#svg-newPeople"/></p>
				</section>
			</div>
		);
	}
};


let mapStateToProps=(state)=>{
	return {};
}; 

let mapDispatchToProps=(dispatch)=>{
	return {
		ACTIONS:bindActionCreators(actions,dispatch)
	};
};
export default connect(mapStateToProps,mapDispatchToProps)(Success);

